-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(SDK+backend): Add optional field for the secret/configmap as env vars #12216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(SDK+backend): Add optional field for the secret/configmap as env vars #12216
Conversation
a5d67de
to
10cdb55
Compare
…ings - Regenerate Python protobuf bindings to include the optional field for SecretAsEnv and ConfigMapAsEnv - Update test_volume.py to expect optional: False in secretAsEnv - Include backend driver code that handles optional field (from stash) - All 110 kfp-kubernetes-library-tests now pass - Fixes PR kubeflow#12216 test failures
…ings - Regenerate Python protobuf bindings to include the optional field for SecretAsEnv and ConfigMapAsEnv - Update test_volume.py to expect optional: False in secretAsEnv - Include backend driver code that handles optional field (from stash) - All 110 kfp-kubernetes-library-tests now pass - Fixes PR kubeflow#12216 test failures Signed-off-by: ddalvi <[email protected]>
d96ac32
to
3293763
Compare
…ndling - Regenerate Python protobuf bindings to include the optional field for SecretAsEnv and ConfigMapAsEnv - Update test_volume.py to expect optional: False in secretAsEnv - Fix backend driver to only set Optional field when explicitly true (maintains backward compatibility) - Prevents breaking existing backend tests that expect Optional to be nil by default - All 110 kfp-kubernetes-library-tests now pass - All backend driver tests now pass - Fixes PR kubeflow#12216 test failures Signed-off-by: ddalvi <[email protected]>
d9c9b5b
to
a1bcee5
Compare
…ndling - Regenerate Python protobuf bindings to include the optional field for SecretAsEnv and ConfigMapAsEnv - Update test_volume.py to expect optional: False in secretAsEnv - Fix backend driver to properly handle Optional field for all cases: * Not specified: Optional = nil → defaults to false in YAML (backward compatible) * Explicitly false: Optional = &false → optional: false in YAML * Explicitly true: Optional = &true → optional: true in YAML - All 110 kfp-kubernetes-library-tests pass - All backend driver tests pass - Sample pipeline compilation tests pass with correct optional field handling - Should fix KFP Samples test failures related to pod-spec-patch - Fixes PR kubeflow#12216 test failures Signed-off-by: ddalvi <[email protected]>
a1bcee5
to
e08a2b9
Compare
e08a2b9
to
d0b11af
Compare
/assign @HumairAK |
|
||
// Name of the ConfigMap. | ||
ml_pipelines.TaskInputsSpec.InputParameterSpec config_map_name_parameter = 3; | ||
ml_pipelines.TaskInputsSpec.InputParameterSpec config_map_name_parameter = 4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should not change the numbers of pre-existing message fields, it will disrupt the wire format for the proto messages, keep the old fields as is and only increment the numbers for the newly added fields
it looks like the one in ConfigMapAsEnv
accidentally skipped a number - it is what it is though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops! Updated to keep the old fields as is, and have incremented numbers for the new "optional" fields.
if secretAsEnv.Optional != nil { | ||
secretKeySelector.Optional = secretAsEnv.Optional | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a unit test for this codepath?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, added tests here.
d0b11af
to
b201949
Compare
91d0e48
to
3996e21
Compare
Signed-off-by: ddalvi <[email protected]>
…iables - Update protobuf definitions and regenerate bindings - Fix backend driver to handle Optional field correctly - Update tests and ensure backward compatibility Signed-off-by: ddalvi <[email protected]>
3996e21
to
70fc60d
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: HumairAK The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
… vars (kubeflow#12216) * Add optional field for the secret/configmap as env vars Signed-off-by: ddalvi <[email protected]> * Add tests for the optional field for secret/configmap environment variables - Update protobuf definitions and regenerate bindings - Fix backend driver to handle Optional field correctly - Update tests and ensure backward compatibility Signed-off-by: ddalvi <[email protected]> --------- Signed-off-by: ddalvi <[email protected]> Co-authored-by: Ricardo M. Oliveira <[email protected]>
… vars (kubeflow#12216) * Add optional field for the secret/configmap as env vars Signed-off-by: ddalvi <[email protected]> * Add tests for the optional field for secret/configmap environment variables - Update protobuf definitions and regenerate bindings - Fix backend driver to handle Optional field correctly - Update tests and ensure backward compatibility Signed-off-by: ddalvi <[email protected]> --------- Signed-off-by: ddalvi <[email protected]> Co-authored-by: Ricardo M. Oliveira <[email protected]>
… vars (kubeflow#12216) * Add optional field for the secret/configmap as env vars Signed-off-by: ddalvi <[email protected]> * Add tests for the optional field for secret/configmap environment variables - Update protobuf definitions and regenerate bindings - Fix backend driver to handle Optional field correctly - Update tests and ensure backward compatibility Signed-off-by: ddalvi <[email protected]> --------- Signed-off-by: ddalvi <[email protected]> Co-authored-by: Ricardo M. Oliveira <[email protected]>
Description of your changes:
Fixes #11401
Adds support for the
optional
parameter tokfp.kubernetes.use_secret_as_env()
andkfp.kubernetes.use_config_map_as_env()
functions, bringing parity with the existing*_as_volume
methods.optional: bool = False
parameter to both functionsoptional
field toSecretAsEnv
andConfigMapAsEnv
messagesBehavior
optional=False
(default): Secret/ConfigMap must exist (backward compatible)optional=True
: Pod can start even if Secret/ConfigMap is missingExample Usage
This PR includes a cherry-picked commit from @rimolive 's past PR, that consisted of the SDK side changes. I've added backend changes and tests on top of those.
Checklist: